/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function Valida( formulario ) {
    var con1=formulario.password1.value;
    var con2=formulario.password2.value;
    var tel= document.getElementById('tel');
    var RegExPatternTel = new RegExp("^[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}$");
    var RegExPatternCel = new RegExp("^044-55-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}$");
    var errorMessage = 'Formato de Telefono Incorrecto.';
    
  if (con1==con2) {
    if ((tel.value.match(RegExPatternTel) || tel.value.match(RegExPatternCel))  && tel.value!='') {
        //jAlert('La información se guardo con Exito.', 'Alert Dialog');
        alert('La información se guardo con Exito.');
        window.parent.location.reload();
        return true;
    } else {
        //jAlert(errorMessage, 'Alert Dialog');
        alert(errorMessage);
        tel.focus();
        return false;
    } 
    
  } else {
      //jAlert('Las contraseñas son diferentes.', 'Alert Dialog');
      alert('Las contraseñas son diferentes.');
    return false
  }
    
    
    

}

function chekar(){
    var ichk=document.getElementById('chk');
    var iRadio=document.getElementById('Radio');
    var iCRP=document.getElementById('CRP');
    var sec=document.getElementById('Sector');
    iCRP.disabled = true;
    
    $(ichk).click(function() {
               if($(ichk).is(":checked")){
                   iRadio.disabled = true;
                   sec.disabled = true;
                   iCRP.disabled = false;
               }else{                     
                   iRadio.disabled = false;
                   sec.disabled = false;
                   iCRP.disabled = true;
               }                
            });    
}

